
	.section .text

	.globl soma
	.type soma,@function

soma: 
	pushl %ebp
	movl (%esp),%ebp
	movl $2,%eax
	movl %eax,x_
	movl x_,%eax
	movl %eax,y_
	movl x_,%eax
	pushl %eax
	movl y_,%eax
	flds %eax
	addl	%eax,(%esp)
	popl	%eax
	movl %ebp,(%esp)
	popl %ebp
	ret

	.globl somaDois
	.type somaDois,@function

somaDois: 
	pushl %ebp
	movl (%esp),%ebp
	movl %eax,y_
	movl 12(%ebp),%eax
	pushl %eax
	movl 8(%ebp),%eax
	flds %eax
	addl	%eax,(%esp)
	popl	%eax
	jmp somaDois.conclusion
somaDois.conclusion:
	movl %ebp,(%esp)
	popl %ebp
	ret

	.globl somaTres
	.type somaTres,@function

somaTres: 
	pushl %ebp
	movl (%esp),%ebp
	movl $2,%eax
	pushl %eax
	movl $3,%eax
	addl	%eax,(%esp)
	popl	%eax
	jmp somaTres.conclusion
somaTres.conclusion:
	movl %ebp,(%esp)
	popl %ebp
	ret

	.globl somaQuatro
	.type somaQuatro,@function

somaQuatro: 
	pushl %ebp
	movl (%esp),%ebp
	movl 12(%ebp),%eax
	pushl %eax
	movl 8(%ebp),%eax
	flds %eax
	addl	%eax,(%esp)
	popl	%eax
	movl %ebp,(%esp)
	popl %ebp
	ret

	.globl main
	.type main,@function

main: 
	pushl %ebp
	movl (%esp),%ebp
	movl %eax,x_
	movl $2,%eax
	movl %eax,y_
	movl $3,%eax
	movl %eax,x_
	movl x_,%eax
	pushl %eax
	movl y_,%eax
	flds %eax
	addl	%eax,(%esp)
	popl	%eax
.L1:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $8,%eax
	cmpl	%eax,(%esp)
	jge .L2
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $5,%eax
	cmpl	%eax,(%esp)
	jne .L3
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	faddps	%eax,%st(7)
	popl	%eax
	jmp .L4
.L3:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	faddps	%eax,%st(8)
	popl	%eax
.L4:
	jmp .L1
.L2:
.L5:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $20,%eax
	cmpl	%eax,(%esp)
	flds %eax
	jge .L6
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	faddps	%eax,%st(11)
	popl	%eax
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x4A800000,%eax
	flds %eax
	cltd
	idivl	(%esp)
	movl	%edx, %eax
	popl	%eax
	pushl %eax
	movl $0,%eax
	cmpl	%eax,(%esp)
	flds %eax
	jne .L7
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	fsubps	%eax,%st(15)
	popl	%eax
.L7:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	cltd
	idivl	(%esp)
	movl	%edx, %eax
	popl	%eax
	pushl %eax
	movl $0,%eax
	cmpl	%eax,(%esp)
	flds %eax
	jne .L8
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	faddps	%eax,%st(19)
	popl	%eax
	jmp .L9
.L8:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x4A800000,%eax
	flds %eax
	faddps	%eax,%st(20)
	popl	%eax
.L9:
	jmp .L10
.L6:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $0x00000000,%eax
	flds %eax
	faddps	%eax,%st(21)
	popl	%eax
.L10:
	movl %eax,y_
	movl y_,%eax
	flds %eax
	pushl %eax
	movl $25,%eax
	cmpl	%eax,(%esp)
	flds %eax
	jg .L5
	movl $3,%eax

#end program (exit)
	movl $1,%eax
	movl $0,%ebx
	int $0x80
